﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BMS.DTO
{
    /// <summary>
    /// 用于传输用户登录数据的dto
    /// </summary>
    public class LoginRequestDTO
    {
        /// <summary>
        /// 用户名
        /// </summary>
        [Required(ErrorMessage ="请输入用户名")]
        [StringLength(20,ErrorMessage ="用户名最大为20位")]
        public string UserName { get; set; }
        /// <summary>
        /// 密码
        /// </summary>
        [Required(ErrorMessage = "请输入密码")]
        [MinLength(3,ErrorMessage ="至少输入3位密码")]
        [RegularExpression(@"([0-9]|[a-z]|[A-Z])*",ErrorMessage ="密码是纯数字")]
        public string Password { get; set; }
        /// <summary>
        /// 验证码
        /// </summary>
        [Required(ErrorMessage = "请输入验证码")]
        public string ValidateCode { get; set; }
    }
}
